-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') vtag=GetVarInt(mg.request_info.query_string,'vtag') or -1 ct=CreateContentBuilder(GZIP_THRESHOLD_BYTE) ct:Append([=[

# 予約一覧

]=]) rsdef=(edcb.GetReserveData(0x7FFFFFFF) or {}).recSetting rate={} for i=page*pageCount+1,math.min(#a,(page+1)*pageCount) do v=a[i] size=nil if (v.recSetting.recMode~=5 and v.recSetting.recMode or v.recSetting.noRecMode or 1)~=4 then --予想ファイルサイズ for j=1,4 do key=('%04X%04X%04X'):format((j>3 and 65535 or v.onid),(j>2 and 65535 or v.tsid),(j>1 and 65535 or v.sid)) rate[key]=rate[key] or tonumber(edcb.GetPrivateProfile('BITRATE',key,0,'Bitrate.ini')) or 0 if rate[key]>0 then break elseif j==4 then rate[key]=19456 end end size=rate[key]/8*1000*math.max((v.recSetting.startMargin or rsdef and rsdef.startMargin or 0)+ (v.recSetting.endMargin or rsdef and rsdef.endMargin or 0)+v.durationSecond,0) end cl=v.recSetting.recMode==5 and ' class="disabled"' or v.overlapMode==1 and ' class="partially"' or v.overlapMode==2 and ' class="shortage"' or '' ct:Append('
' ..FormatTimeAndDuration(v.startTime, v.durationSecond) ..''..v.stationName..''..v.title ..''..(RecModeTextList()[(v.recSetting.recMode~=5 and v.recSetting.recMode or v.recSetting.noRecMode or 1)+1] or '') ..''..v.recSetting.priority ..''..(size and ('%.1fG'):format(size/1024/1024/1024) or '')..'
\n') end ct:Append([=[

]=]) a={} for i,v in ipairs(edcb.FindFile('\\\\.\\pipe\\SendTSTCP_*',0) or {}) do n=v.name:match('^[^_]+_(%d+)_%d+$') if n then a[#a+1]=n end end if #a>0 then n=mg.get_var(mg.request_info.query_string,'n') or a[1] xq=GetTranscodeQueries(mg.request_info.query_string) ct:Append('視聴 →'..(vtag==0 and 'Video' or 'DL')..'\n' ..'
\n' ..'
\n' ..'
\n' ..TranscodeSettingTemplete(xq) ..(vtag==0 and '\n' or '\n') ..'
\n') if vtag==1 then for i,v in ipairs(a) do if n==v then src='view.lua?n='..v..ConstructTranscodeQueries(xq)..'&ctok='..CsrfToken('view.lua') ct:Append('
' ..'
' ..'
' ..'
' ..'view
\n' ..'
'..src..'
\n'..TranscodeScriptTemplete(true,{n=v})) if ALLOW_HLS then ct:Append(HlsScriptTemplete()) end ct:Append('\n') break end end end end ct:Append([=[
]=]) ct:Finish() mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len)..(ct.gzip and 'Content-Encoding: gzip\r\n' or '')..'\r\n'))